﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

using KnowledgeBase;
using KnowledgeBaseIntermediary;
using LisaConfigurator;

namespace InputHandler
{
    public delegate void HandleInput(InputEventArgs args);

    /// <summary>
    /// This interface provides methods to start, stop and initialize the InputHandler. Additionally, a method is
    /// provided to inform the InputHandler of any state changes.
    /// </summary>
    public interface IInputHandler
    {
        /// <summary>
        /// This event gets fired when the InputHandler has received and processed a new user command.
        /// </summary>
        event HandleInput commandReceived;

        /// <summary>
        /// This event gets fired when the InputHandler has received and processed a new environment event
        /// from the HomeServer.
        /// </summary>
        event HandleInput environmentEventReceived;

        /// <summary>
        /// Initializes the InputHandler.
        /// </summary>
        void initialize(IKnowledgeBase knowledgeBase, IConfigurationAccessor lisaConfigurator);

        /// <summary>
        /// Starts the InputHandler. The InputHandler runs in its own thread.
        /// </summary>
        void start();

        /// <summary>
        /// Stops the InputHandler.
        /// </summary>
        void stop();

        /// <summary>
        /// Informs the InputHandler of a state change. This allows it to adjust its Grammar needed for
        /// speech recognition to include the commands and scenes in the new state.
        /// </summary>
        /// <param name="newState"></param>
        void changeState(StateDTO newState);
    }
}
